using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using MAPDavy.Entities;

namespace MAPDavy.Repository.Mapping
{
	public class ReportMap : EntityTypeConfiguration<Report>
	{
		public ReportMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.NameReport)
				.IsRequired()
				.HasMaxLength(255);
				
			this.Property(t => t.FileNameReport)
				.IsRequired()
				.HasMaxLength(255);
				
			this.Property(t => t.DescRerport)
				.HasMaxLength(255);
				
			this.Property(t => t.UrlImageRecord)
				.IsRequired()
				.HasMaxLength(255);
				
			// Table & Column Mappings
			this.ToTable("Report");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.NameReport).HasColumnName("NameReport");
			this.Property(t => t.FileNameReport).HasColumnName("FileNameReport");
			this.Property(t => t.DescRerport).HasColumnName("DescRerport");
			this.Property(t => t.UrlImageRecord).HasColumnName("UrlImageRecord");
		}
	}
}

